var status = -1;
var level = "33";
var header = "#fn黑体##fs32#B - " + level + " F\r\n\r\n";

function action(g, h, k) {
    status++;
    var c = cm.getEventManager("副本_起源之塔");
    var b = c.getMapFactoryMap(cm.getMapId());
    var a = c == null ? null : c.getProperty("stage" + level);
    if (a != null && (a.equals("start") || a.equals("clear"))) {
        cm.dispose();
        return
    }
    if (cm.getInfoQuest(42001).contains("noHelp=1")) {
        startMap(c);
        return
    }
    var f = -1;
    if (status <= f++) {
        cm.dispose()
    } else {
        if (status === f++) {
            for (var f = 0; f < 5; f++) {
                for (var e = 0; e < 5; e++) {
                    var d = b.getReactorByName(f + "" + e);
                    d.forceHitReactor(cm.getPlayer(), cm.rand(0, 3))
                }
            }
            cm.curNodeEventEnd(true);
            cm.setInGameDirectionMode(true, false);
            cm.setStandAloneMode(true);
            cm.inGameDirectionEvent_AskAnswerTime(30)
        } else {
            if (status === f++) {
                cm.fieldEffect_InsertCanvas(1, 128, 0, 0, 0, 1000, 0);
                cm.inGameDirectionEvent_AskAnswerTime(1000)
            } else {
                if (status === f++) {
                    cm.inGameDirectionEvent_Monologue(header + "#fs22#这楼是有着古代植物的植物圈。\r\n\r\n啊，这些家伙们混在植物园的房间里，无法轻易地走下去。\r\n\r\n通过传送点前要仔细看好方向，请移动至右边最里面的传送点。不是想要的方向的话，丢下迷宫钥匙 - 逆时针方向或	迷宫钥匙 - 顺时针方向就会改变方向，好好珍惜使用它们。", 30000)
                } else {
                    if (status === f++) {
                        cm.fieldEffect_InsertCanvas(0, 0, 0, 0, 1000, 0, 0);
                        cm.curNodeEventEnd(true);
                        cm.setInGameDirectionMode(false, true);
                        cm.setStandAloneMode(false);
                        startMap(c)
                    } else {
                        cm.dispose()
                    }
                }
            }
        }
    }
}

function startMap(a) {
    cm.dispose();
    cm.updateHeaderUI(1, 2, cm.getEventInstance().getTimeLeft(), 0, cm.getEventInstance().getTimeLeft(), 42011);
    a.setProperty("stage" + level, "start");
    cm.getMap().getWeatherEffectNotice("按照你自己的意愿转动传送口，然后前往下一层吧。", 147, 60000, 1);
    cm.gainItem(4009233, 8);
    cm.fieldEffect_ScreenMsg("UI/UIWindowPL.img/HiddenCatch/StageImg/start")
}

function start() {
    status = -1;
    action(1, 0, 0)
};